package com.shuwei.wificollecttool;

import com.shuwei.location.wificollect.WifiItem;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Halohoop on 2017/11/21.
 */

public final class WifiSingleNeedHolder {
    private volatile static WifiSingleNeedHolder instance;

    /**
     * <mac, WifiHolder>
     */
    private List<WifiItem> wifiHolders = new ArrayList<>();
    private long time;

    private WifiSingleNeedHolder() {
    }

    public static WifiSingleNeedHolder getInstance() {
        if (instance == null) {
            synchronized (WifiSingleNeedHolder.class) {
                if (instance == null) {
                    instance = new WifiSingleNeedHolder();
                }
            }
        }
        return instance;
    }

    public List<WifiItem> getWifiHolders() {
        return wifiHolders;
    }

    public void setWifiHolders(List<WifiItem> wifiHolders) {
        this.wifiHolders = wifiHolders;
    }

    public int size() {
        return wifiHolders.size();
    }

    public void setTime(long l) {
        this.time = l;
    }

    public long getTime() {
        return time;
    }
}
